<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@page import="java.util.*"%>
<%@page import="BLL.*"%>
<%@page import="Model.*"%>
<%@page import="java.text.SimpleDateFormat" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Insert title here</title>
</head>
<body>
<%	request.setCharacterEncoding("utf-8");
	String userName=request.getParameter("userName");
	String passWord=request.getParameter("passWord");
	String Email=request.getParameter("Email");
	String dateDay=request.getParameter("Date");
	try{
    	SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");//yyyy-mm-dd, 会出现时间不对, 因为小写的mm是代表: 秒
    	Date utilDate = sdf.parse(dateDay);
    	Date date = new java.sql.Date(utilDate.getTime());
	
		User u=new User();
		u.setUserName(userName);
		u.setPassword(passWord);
		u.setEmail(Email);
		u.setDate(date);
		new BLL.UserBLL().addUser(u);
		response.sendRedirect("index.jsp?#4F");
	}catch(Exception e){
		e.printStackTrace();
	}%>
</body>
</html>